
<li>
    <div class="iconfont icon-shouji-copy"></div>
    <div>售后热线</div>
    <div class="tel-wx animate__animated animate__fadeInRightBig">
        <a href="#">手机/微信：13360039961</a>
    </div>
</li>
<li>
    <div class="iconfont icon-weixin"></div>
    <div>微信客服</div>
    <div class="wx animate__animated animate__fadeInRightBig">
        <img src="../img/images/code.jpg" >
    </div>
</li>
<li class="toTop">
    <div class="iconfont icon-chevron-copy-copy-copy"></div>
    <div>top</div>
</li>


<script>
        //以一定的速度回到顶部
        let timer = null
        $('.toTop').on('click',function () {
            cancelAnimationFrame(timer);
            //获取当前毫秒数
            var startTime = +new Date();     
            //获取当前页面的滚动高度
            var b = document.body.scrollTop || document.documentElement.scrollTop;
            var d = 500;
            var c = b;
            timer = requestAnimationFrame(function func(){
                var t = d - Math.max(0,startTime - (+new Date()) + d);
                document.documentElement.scrollTop = document.body.scrollTop = t * (-c) / d + b;
                timer = requestAnimationFrame(func);
                if(t == d){
                cancelAnimationFrame(timer);
                }
            });        

        })
</script>